import React, {PureComponent} from 'react'
import '../../css/frame.scss'
import Head from './head'
// import Tool from '../util/tool'
import {connect} from 'react-redux'
import {changeKey} from '../action/map.action'
class Frame extends PureComponent {
    constructor() {
        super()
    }

    handleClick = (key) => {
        const {dispatch} = this.props
        dispatch(changeKey())
    }

    render() {
        return (
            <div className="frame-container">
                <Head handleClick={this.handleClick}/>
                {this.props.children}
            </div>
        )
    }

}

function mapStoreToProps({menuKey}) {
    return {menuKey}
}

export default connect(mapStoreToProps)(Frame)